import { getCompanyID, getUserDepID, getUserID } from '@/utils';

export const AssetacquisitionTabSwitch = (curRes) => {
  if (curRes?.['/assetInventory/createCompanyID']) {
    return {
      createCompanyID: getCompanyID(),
      params: 'createCompanyID',
    };
  } else if (curRes?.['/assetInventory/createDepartmentID']) {
    return {
      createDepartmentID: getUserDepID(),
      params: 'createDepartmentID',
    };
  } else if (curRes?.['/assetInventory/createrID']) {
    return {
      createrID: getUserID(),
      params: 'createrID',
    };
  } else {
    return {};
  }
};

export const inventoryerSwitch = (curRes) => {
  if (curRes?.['/assetInventoryDetail/useCompanyID']) {
    return {
      useCompanyID: getCompanyID(),
      params: 'useCompanyID',
    };
  } else if (curRes?.['/assetInventoryDetail/useDepartmentID']) {
    return {
      useDepartmentID: getUserDepID(),
      params: 'useDepartmentID',
    };
  } else {
    return {};
  }
};

export const DtailedTabSwitch = (curRes) => {
  if (curRes?.['/assetInventoryDetail/useCompanyID']) {
    return {
      useCompanyID: getCompanyID(),
      params: 'useCompanyID',
    };
  } else if (curRes?.['/assetInventoryDetail/useDepartmentID']) {
    return {
      useDepartmentID: getUserDepID(),
      params: 'useDepartmentID',
    };
  } else {
    return {};
  }
};

export const ExportSwitch = (curRes) => {
  if (curRes?.['/assetInventory/createCompanyID']) {
    return {
      useCompanyID: getCompanyID(),
      params: 'useCompanyID',
    };
  } else if (curRes?.['/assetInventory/createDepartmentID']) {
    return {
      useDepartmentID: getUserDepID(),
      params: 'useDepartmentID',
    };
  } else if (curRes?.['/assetInventory/createrID']) {
    return {
      UserID: getUserID(),
      params: 'UserID',
    };
  } else {
    return {};
  }
};
// if (curRes?.['/assetInventory/createCompanyID']) {
//   return {
//     useCompanyID: getCompanyID(),
//     params: 'useCompanyID',
//   };
// } else if (curRes?.['/assetInventory/createDepartmentID']) {
//   return {
//     useDepartmentID: getUserDepID(),
//     params: 'useDepartmentID',
//   };
// } else if (curRes?.['/assetInventory/createrID']) {
//   return {
//     UserID: getUserID(),
//     params: 'UserID',
//   };
// } else {
//   return {};
// }
// };

export const DifferTabSwitch = (curRes) => {
  if (curRes?.['/assetInventory/createDepartmentID']) {
    return {
      createDepartmentID: getUserDepID(),
      params: 'createDepartmentID',
    };
  } else {
    return {};
  }
};
